﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Task5.aspx.cs" Inherits="Web.UI.Task5" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:GridView
            ID="GridView1"
            runat="server"
            AutoGenerateColumns="false"
            DataSourceID="ObjectDataSource1"
            >
            <Columns>
                <asp:BoundField DataField="CarNumber" HeaderText="CarNumber" />
                <asp:BoundField DataField="Weight" HeaderText="Weight" />
                <asp:BoundField DataField="ArrivalStation" HeaderText="ArrivalStation" />
                <asp:BoundField DataField="CargoCode" HeaderText="CargoCode" />
                <asp:BoundField DataField="ConsigneeCode" HeaderText="ConsigneeCode" />
                <asp:BoundField DataField="CarParkType" HeaderText="CarParkType" />
                <asp:BoundField DataField="DispatchStation" HeaderText="DispatchStation" />
                <asp:BoundField DataField="OperationCode" HeaderText="OperationCode" />
                <asp:BoundField DataField="OperationDate" HeaderText="OperationDate" />
                <asp:BoundField DataField="OperationYear" HeaderText="OperationYear" />
                <asp:BoundField DataField="OperationTime" HeaderText="OperationTime" />
                <asp:BoundField DataField="OperationStation" HeaderText="OperationStation" />
                <asp:BoundField DataField="RoadOfDelivery" HeaderText="RoadOfDelivery" />
                <asp:BoundField DataField="RoadOfReception" HeaderText="RoadOfReception" />
                <asp:BoundField DataField="TrainIndex" HeaderText="TrainIndex" />
                <asp:BoundField DataField="TrainNumber" HeaderText="TrainNumber" />
            </Columns>
        </asp:GridView>
        <asp:ObjectDataSource 
                ID="ObjectDataSource1" 
                runat="server" 
                SelectMethod="GetBaseInfo" 
                TypeName="DigDes.DSchool.SUPS.DataAccess.Database.BaseDAC">
            </asp:ObjectDataSource>
        
        <asp:DetailsView
            ID="DetailsVeiw1"
            runat="server"
            DataSourceID="SUPSDetailsODS"
            AutoGenerateRows="true"
            >
            <Fields>
                <asp:TemplateField HeaderText="CarNumber">
                     <ItemTemplate>
                         <asp:Label ID="CarNumberLb" runat="server" Text='<%# Eval("CarNum") %>'></asp:Label>
                     </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Weight">
                     <ItemTemplate>
                         <asp:Label ID="WeightLb" runat="server" Text='<%# Eval("Weight") %>'></asp:Label>
                     </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="ArrivalStation">
                     <ItemTemplate>
                         <asp:Label ID="ArrivalStationLb" runat="server" Text='<%# Eval("ArrivalStation") %>'></asp:Label>
                     </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="CargoCode">
                     <ItemTemplate>
                         <asp:Label ID="CargoCodeLb" runat="server" Text='<%# Eval("CargoCode") %>'></asp:Label>
                     </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="ConsigneeCode">
                     <ItemTemplate>
                         <asp:Label ID="ConsigneeCodeLb" runat="server" Text='<%# Eval("ConsigneeCode") %>'></asp:Label>
                     </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="CarParkType">
                     <ItemTemplate>
                         <asp:Label ID="CarParkTypeLb" runat="server" Text='<%# Eval("CarParkType") %>'></asp:Label>
                     </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="DispatchStation">
                     <ItemTemplate>
                         <asp:Label ID="CarParkTypeLb" runat="server" Text='<%# Eval("CarParkType") %>'></asp:Label>
                     </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="OperationCode">
                     <ItemTemplate>
                         <asp:Label ID="OperationCodeLb" runat="server" Text='<%# Eval("OperationCode") %>'></asp:Label>
                     </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="OperationDate">
                     <ItemTemplate>
                         <asp:Label ID="OperationDateLb" runat="server" Text='<%# Eval("OperationDate") %>'></asp:Label>
                     </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="OperationYear">
                     <ItemTemplate>
                         <asp:Label ID="OperationYearLb" runat="server" Text='<%# Eval("OperationYear") %>'></asp:Label>
                     </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="OperationStation">
                     <ItemTemplate>
                         <asp:Label ID="OperationStationlb" runat="server" Text='<%# Eval("OperationStation") %>'></asp:Label>
                     </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="RoadOfDelivery">
                     <ItemTemplate>
                         <asp:Label ID="RoadOfDeliveryLb" runat="server" Text='<%# Eval("RoadOfDelivery") %>'></asp:Label>
                     </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="RoadOfReception">
                     <ItemTemplate>
                         <asp:Label ID="RoadOfReceptionLb" runat="server" Text='<%# Eval("RoadOfReception") %>'></asp:Label>
                     </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="TrainIndex">
                     <ItemTemplate>
                         <asp:Label ID="TrainIndexLb" runat="server" Text='<%# Eval("TrainIndex") %>'></asp:Label>
                     </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="TrainNumber">
                     <ItemTemplate>
                         <asp:Label ID="TrainNumberLb" runat="server" Text='<%# Eval("TrainNumber") %>'></asp:Label>
                     </ItemTemplate>
                </asp:TemplateField>

            </Fields>
        </asp:DetailsView>
        
        <asp:ObjectDataSource
            ID="SUPSDetailsODS"
            runat="server"
            SelectMethod="GetSUPSRow"
            UpdateMethod="UpdateSUPSRow"
            TypeName="DigDes.Dschool.SUPS.DataAccess.Database.BaseDAC"
            >
            
            <SelectParameters>
                <asp:Parameter Name="CarNum" Type="String"/>                
            </SelectParameters>

            <UpdateParameters>
                <asp:Parameter Name="CarNumber" Type="String"/>
                <asp:Parameter Name="Weight" Type="String" />
                <asp:Parameter Name="ArrivalStation" Type="String" />
                <asp:Parameter Name="CargoCode" Type="String" />
                <asp:Parameter Name="ConsigneeCode" Type="String" />
                <asp:Parameter Name="CarParkType" Type="String" />
                <asp:Parameter Name="DispatchStation" Type="String" />
                <asp:Parameter Name="OperationCode" Type="String" />
                <asp:Parameter Name="OperationDate" Type="String" />
                <asp:Parameter Name="OperationYear" Type="String" />
                <asp:Parameter Name="OperationTime" Type="String" />
                <asp:Parameter Name="OperationStation" Type="String" />
                <asp:Parameter Name="RoadOfDelivery" Type="String" />
                <asp:Parameter Name="RoadOfReception" Type="String" />
                <asp:Parameter Name="TrainIndex" Type="String" />
                <asp:Parameter Name="TrainNumber" Type="String" />

            </UpdateParameters>
        </asp:ObjectDataSource>

    
    </div>
    </form>
</body>
</html>
